package com.allwees.support.marketing.dto;

import com.allwees.support.marketing.domain.HotWord;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * @Author Daniel
 * @Version 1.0.0
 * @Description
 * @CreateTime 2020/8/31 16:24
 */
@Data
public class HotWordDto {

    @NotNull(groups = Edit.class)
    private Long id;

    @NotNull(groups = {Add.class})
    @Length(max = 20)
    private String word;

    private Boolean highlight;

    private Integer sort;

    public interface Add {
    }

    public interface Edit {
    }

    public HotWordDto() {
    }

    public HotWordDto(HotWord hotWord) {
        this.word = hotWord.getWord();
        this.highlight = hotWord.getHighlight();
    }
}
